package com.xiaoxie.cloud.apis;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.xiaoxie.cloud.resp.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

// 这里指定fallback，那么消费端在调用服务端接口时，如果服务端接口出现异常，那么就会调用fallback方法
@FeignClient(value = "nacos-payment-provider",fallback = PayFeignSentinelApiFallBack.class)
public interface PayFeignSentinelApi {

    // 微服务对外暴露提供的接口
    @GetMapping("/pay/nacos/get/{orderNo}")
    ResultData getPayOrderNo(@PathVariable("orderNo") String orderNo);
}
